<h1>Select Artist</h1>

<% form_remote_for @artist_search do |f| %>
  <%= f.label :name_like, "Name:" %>
  <%= f.text_field :name_like %>
  <%= f.submit "Search" %>
<% end %>

<% if !@artists.nil? %>
  <% @artists.each do |artist| %>
      <%=h artist.name %><br />
      <%= link_to 'Select', select_search_index_path(:artist_id => artist.id), :method => :post %>
    <hr />
  <% end %>

  Not what you're looking for? Create an entry for <%=h params[:search][:name_like] %>?
  <%= link_to 'Create', select_search_index_path(:name => params[:search][:name_like]), :method => :post %>
<% end %>
